import { _decorator, Component, Label, Node, tween, Tween, UIOpacity } from 'cc';
import $planet_DC_poof$ from '../data/data.center';
import $planet_GameAssets_poof$ from '../manager/game-assets';
const { ccclass, property } = _decorator;

@ccclass('$planet_Congratulation_poof$')
export class $planet_Congratulation_poof$ extends Component {
	@property(Label)
	private $planet_lbl_symbol_poof$: Label = null;
	@property(Label)
	private $planet_lbl_desc_poof$: Label = null;

	private $planet_opacity_poof$: UIOpacity;

	protected onLoad(){
		this.$planet_opacity_poof$ = this.node.getComponent(UIOpacity);
		this.$planet_renderLocalUI_poof$();
	}

	$planet_show_poof$(symbol: number, desc: string){
		let np = new abd.$planet_NudityPromise_poof$<Node>();
		this.node.active = true;
		this.$planet_lbl_symbol_poof$.string = $planet_DC_poof$.$planet_symbolString_poof$(symbol);
		this.$planet_lbl_desc_poof$.string = desc;

		Tween.stopAllByTarget(this.$planet_opacity_poof$);
		this.$planet_opacity_poof$.opacity = 0;
		tween(this.$planet_opacity_poof$).to(0.35, {opacity: 255}, {easing: 'quadIn'}).start();

		abd.$planet_delay_poof$(1.3, ()=>np.$planet_resolve_poof$(this.node));
		return np.$planet_promise_poof$;
	}

	private $planet_renderLocalUI_poof$(){
		abd.$planet_cc_poof$.$planet_skinPeeler_poof$(this.node.getChildByName('icon'), $planet_GameAssets_poof$.$planet_getCounTexture_poof$(1), {height: true});
	}
}

